home *** CD-ROM | disk | FTP | other *** search
/ Aminet 8 / Aminet 8 (1995)(GTI - Schatztruhe)[!][Oct 1995].iso / Aminet / dev / gcc / gcc270_src.lha / gcc-2.7.0-amiga / gcc.info-3 (.txt) < prev    next >
GNU Info File  |  1995-06-16  |  48KB  |  938 lines

  1. This is Info file gcc.info, produced by Makeinfo-1.55 from the input
  2. file gcc.texi.
  3.    This file documents the use and the internals of the GNU compiler.
  4.    Published by the Free Software Foundation 59 Temple Place - Suite 330
  5. Boston, MA 02111-1307 USA
  6.    Copyright (C) 1988, 1989, 1992, 1993, 1994, 1995 Free Software
  7. Foundation, Inc.
  8.    Permission is granted to make and distribute verbatim copies of this
  9. manual provided the copyright notice and this permission notice are
  10. preserved on all copies.
  11.    Permission is granted to copy and distribute modified versions of
  12. this manual under the conditions for verbatim copying, provided also
  13. that the sections entitled "GNU General Public License," "Funding for
  14. Free Software," and "Protect Your Freedom--Fight `Look And Feel'" are
  15. included exactly as in the original, and provided that the entire
  16. resulting derived work is distributed under the terms of a permission
  17. notice identical to this one.
  18.    Permission is granted to copy and distribute translations of this
  19. manual into another language, under the above conditions for modified
  20. versions, except that the sections entitled "GNU General Public
  21. License," "Funding for Free Software," and "Protect Your Freedom--Fight
  22. `Look And Feel'", and this permission notice, may be included in
  23. translations approved by the Free Software Foundation instead of in the
  24. original English.
  25. File: gcc.info,  Node: Warning Options,  Next: Debugging Options,  Prev: C++ Dialect Options,  Up: Invoking GCC
  26. Options to Request or Suppress Warnings
  27. =======================================
  28.    Warnings are diagnostic messages that report constructions which are
  29. not inherently erroneous but which are risky or suggest there may have
  30. been an error.
  31.    You can request many specific warnings with options beginning `-W',
  32. for example `-Wimplicit' to request warnings on implicit declarations.
  33. Each of these specific warning options also has a negative form
  34. beginning `-Wno-' to turn off warnings; for example, `-Wno-implicit'.
  35. This manual lists only one of the two forms, whichever is not the
  36. default.
  37.    These options control the amount and kinds of warnings produced by
  38. GNU CC:
  39. `-fsyntax-only'
  40.      Check the code for syntax errors, but don't do anything beyond
  41.      that.
  42. `-pedantic'
  43.      Issue all the warnings demanded by strict ANSI standard C; reject
  44.      all programs that use forbidden extensions.
  45.      Valid ANSI standard C programs should compile properly with or
  46.      without this option (though a rare few will require `-ansi').
  47.      However, without this option, certain GNU extensions and
  48.      traditional C features are supported as well.  With this option,
  49.      they are rejected.
  50.      `-pedantic' does not cause warning messages for use of the
  51.      alternate keywords whose names begin and end with `__'.  Pedantic
  52.      warnings are also disabled in the expression that follows
  53.      `__extension__'.  However, only system header files should use
  54.      these escape routes; application programs should avoid them.
  55.      *Note Alternate Keywords::.
  56.      This option is not intended to be useful; it exists only to satisfy
  57.      pedants who would otherwise claim that GNU CC fails to support the
  58.      ANSI standard.
  59.      Some users try to use `-pedantic' to check programs for strict ANSI
  60.      C conformance.  They soon find that it does not do quite what they
  61.      want: it finds some non-ANSI practices, but not all--only those
  62.      for which ANSI C *requires* a diagnostic.
  63.      A feature to report any failure to conform to ANSI C might be
  64.      useful in some instances, but would require considerable
  65.      additional work and would be quite different from `-pedantic'.  We
  66.      recommend, rather, that users take advantage of the extensions of
  67.      GNU C and disregard the limitations of other compilers.  Aside
  68.      from certain supercomputers and obsolete small machines, there is
  69.      less and less reason ever to use any other C compiler other than
  70.      for bootstrapping GNU CC.
  71. `-pedantic-errors'
  72.      Like `-pedantic', except that errors are produced rather than
  73.      warnings.
  74.      Inhibit all warning messages.
  75. `-Wno-import'
  76.      Inhibit warning messages about the use of `#import'.
  77. `-Wchar-subscripts'
  78.      Warn if an array subscript has type `char'.  This is a common cause
  79.      of error, as programmers often forget that this type is signed on
  80.      some machines.
  81. `-Wcomment'
  82.      Warn whenever a comment-start sequence `/*' appears in a comment.
  83. `-Wformat'
  84.      Check calls to `printf' and `scanf', etc., to make sure that the
  85.      arguments supplied have types appropriate to the format string
  86.      specified.
  87. `-Wimplicit'
  88.      Warn whenever a function or parameter is implicitly declared.
  89. `-Wparentheses'
  90.      Warn if parentheses are omitted in certain contexts, such as when
  91.      there is an assignment in a context where a truth value is
  92.      expected, or when operators are nested whose precedence people
  93.      often get confused about.
  94. `-Wreturn-type'
  95.      Warn whenever a function is defined with a return-type that
  96.      defaults to `int'.  Also warn about any `return' statement with no
  97.      return-value in a function whose return-type is not `void'.
  98. `-Wswitch'
  99.      Warn whenever a `switch' statement has an index of enumeral type
  100.      and lacks a `case' for one or more of the named codes of that
  101.      enumeration.  (The presence of a `default' label prevents this
  102.      warning.)  `case' labels outside the enumeration range also
  103.      provoke warnings when this option is used.
  104. `-Wtrigraphs'
  105.      Warn if any trigraphs are encountered (assuming they are enabled).
  106. `-Wunused'
  107.      Warn whenever a variable is unused aside from its declaration,
  108.      whenever a function is declared static but never defined, whenever
  109.      a label is declared but not used, and whenever a statement
  110.      computes a result that is explicitly not used.
  111.      To suppress this warning for an expression, simply cast it to
  112.      void.  For unused variables and parameters, use the `unused'
  113.      attribute (*note Variable Attributes::.).
  114. `-Wuninitialized'
  115.      An automatic variable is used without first being initialized.
  116.      These warnings are possible only in optimizing compilation,
  117.      because they require data flow information that is computed only
  118.      when optimizing.  If you don't specify `-O', you simply won't get
  119.      these warnings.
  120.      These warnings occur only for variables that are candidates for
  121.      register allocation.  Therefore, they do not occur for a variable
  122.      that is declared `volatile', or whose address is taken, or whose
  123.      size is other than 1, 2, 4 or 8 bytes.  Also, they do not occur for
  124.      structures, unions or arrays, even when they are in registers.
  125.      Note that there may be no warning about a variable that is used
  126.      only to compute a value that itself is never used, because such
  127.      computations may be deleted by data flow analysis before the
  128.      warnings are printed.
  129.      These warnings are made optional because GNU CC is not smart
  130.      enough to see all the reasons why the code might be correct
  131.      despite appearing to have an error.  Here is one example of how
  132.      this can happen:
  133.           {
  134.             int x;
  135.             switch (y)
  136.               {
  137.               case 1: x = 1;
  138.                 break;
  139.               case 2: x = 4;
  140.                 break;
  141.               case 3: x = 5;
  142.               }
  143.             foo (x);
  144.           }
  145.      If the value of `y' is always 1, 2 or 3, then `x' is always
  146.      initialized, but GNU CC doesn't know this.  Here is another common
  147.      case:
  148.           {
  149.             int save_y;
  150.             if (change_y) save_y = y, y = new_y;
  151.             ...
  152.             if (change_y) y = save_y;
  153.           }
  154.      This has no bug because `save_y' is used only if it is set.
  155.      Some spurious warnings can be avoided if you declare all the
  156.      functions you use that never return as `noreturn'.  *Note Function
  157.      Attributes::.
  158. `-Wenum-clash'
  159.      Warn about conversion between different enumeration types.  (C++
  160.      only).
  161. `-Wreorder (C++ only)'
  162.      Warn when the order of member initializers given in the code does
  163.      not match the order in which they must be executed.  For instance:
  164.           struct A {
  165.             int i;
  166.             int j;
  167.             A(): j (0), i (1) { }
  168.           };
  169.      Here the compiler will warn that the member initializers for `i'
  170.      and `j' will be rearranged to match the declaration order of the
  171.      members.
  172. `-Wtemplate-debugging'
  173.      When using templates in a C++ program, warn if debugging is not yet
  174.      fully available (C++ only).
  175. `-Wall'
  176.      All of the above `-W' options combined.  These are all the options
  177.      which pertain to usage that we recommend avoiding and that we
  178.      believe is easy to avoid, even in conjunction with macros.
  179.    The remaining `-W...' options are not implied by `-Wall' because
  180. they warn about constructions that we consider reasonable to use, on
  181. occasion, in clean programs.
  182.      Print extra warning messages for these events:
  183.         * A nonvolatile automatic variable might be changed by a call to
  184.           `longjmp'.  These warnings as well are possible only in
  185.           optimizing compilation.
  186.           The compiler sees only the calls to `setjmp'.  It cannot know
  187.           where `longjmp' will be called; in fact, a signal handler
  188.           could call it at any point in the code.  As a result, you may
  189.           get a warning even when there is in fact no problem because
  190.           `longjmp' cannot in fact be called at the place which would
  191.           cause a problem.
  192.         * A function can return either with or without a value.
  193.           (Falling off the end of the function body is considered
  194.           returning without a value.)  For example, this function would
  195.           evoke such a warning:
  196.                foo (a)
  197.                {
  198.                  if (a > 0)
  199.                    return a;
  200.                }
  201.         * An expression-statement contains no side effects.
  202.         * An unsigned value is compared against zero with `<' or `<='.
  203.         * A comparison like `x<=y<=z' appears; this is equivalent to
  204.           `(x<=y ? 1 : 0) <= z', which is a different interpretation
  205.           from that of ordinary mathematical notation.
  206.         * Storage-class specifiers like `static' are not the first
  207.           things in a declaration.  According to the C Standard, this
  208.           usage is obsolescent.
  209.         * If `-Wall' or `-Wunused' is also specified, warn about unused
  210.           arguments.
  211.         * An aggregate has a partly bracketed initializer.  For
  212.           example, the following code would evoke such a warning,
  213.           because braces are missing around the initializer for `x.h':
  214.                struct s { int f, g; };
  215.                struct t { struct s h; int i; };
  216.                struct t x = { 1, 2, 3 };
  217. `-Wtraditional'
  218.      Warn about certain constructs that behave differently in
  219.      traditional and ANSI C.
  220.         * Macro arguments occurring within string constants in the
  221.           macro body.  These would substitute the argument in
  222.           traditional C, but are part of the constant in ANSI C.
  223.         * A function declared external in one block and then used after
  224.           the end of the block.
  225.         * A `switch' statement has an operand of type `long'.
  226. `-Wshadow'
  227.      Warn whenever a local variable shadows another local variable.
  228. `-Wid-clash-LEN'
  229.      Warn whenever two distinct identifiers match in the first LEN
  230.      characters.  This may help you prepare a program that will compile
  231.      with certain obsolete, brain-damaged compilers.
  232. `-Wlarger-than-LEN'
  233.      Warn whenever an object of larger than LEN bytes is defined.
  234. `-Wpointer-arith'
  235.      Warn about anything that depends on the "size of" a function type
  236.      or of `void'.  GNU C assigns these types a size of 1, for
  237.      convenience in calculations with `void *' pointers and pointers to
  238.      functions.
  239. `-Wbad-function-cast'
  240.      Warn whenever a function call is cast to a non-matching type.  For
  241.      example, warn if `int malloc()' is cast to `anything *'.
  242. `-Wcast-qual'
  243.      Warn whenever a pointer is cast so as to remove a type qualifier
  244.      from the target type.  For example, warn if a `const char *' is
  245.      cast to an ordinary `char *'.
  246. `-Wcast-align'
  247.      Warn whenever a pointer is cast such that the required alignment
  248.      of the target is increased.  For example, warn if a `char *' is
  249.      cast to an `int *' on machines where integers can only be accessed
  250.      at two- or four-byte boundaries.
  251. `-Wwrite-strings'
  252.      Give string constants the type `const char[LENGTH]' so that
  253.      copying the address of one into a non-`const' `char *' pointer
  254.      will get a warning.  These warnings will help you find at compile
  255.      time code that can try to write into a string constant, but only
  256.      if you have been very careful about using `const' in declarations
  257.      and prototypes.  Otherwise, it will just be a nuisance; this is
  258.      why we did not make `-Wall' request these warnings.
  259. `-Wconversion'
  260.      Warn if a prototype causes a type conversion that is different
  261.      from what would happen to the same argument in the absence of a
  262.      prototype.  This includes conversions of fixed point to floating
  263.      and vice versa, and conversions changing the width or signedness
  264.      of a fixed point argument except when the same as the default
  265.      promotion.
  266.      Also, warn if a negative integer constant expression is implicitly
  267.      converted to an unsigned type.  For example, warn about the
  268.      assignment `x = -1' if `x' is unsigned.  But do not warn about
  269.      explicit casts like `(unsigned) -1'.
  270. `-Waggregate-return'
  271.      Warn if any functions that return structures or unions are defined
  272.      or called.  (In languages where you can return an array, this also
  273.      elicits a warning.)
  274. `-Wstrict-prototypes'
  275.      Warn if a function is declared or defined without specifying the
  276.      argument types.  (An old-style function definition is permitted
  277.      without a warning if preceded by a declaration which specifies the
  278.      argument types.)
  279. `-Wmissing-prototypes'
  280.      Warn if a global function is defined without a previous prototype
  281.      declaration.  This warning is issued even if the definition itself
  282.      provides a prototype.  The aim is to detect global functions that
  283.      fail to be declared in header files.
  284. `-Wmissing-declarations'
  285.      Warn if a global function is defined without a previous
  286.      declaration.  Do so even if the definition itself provides a
  287.      prototype.  Use this option to detect global functions that are
  288.      not declared in header files.
  289. `-Wredundant-decls'
  290.      Warn if anything is declared more than once in the same scope,
  291.      even in cases where multiple declaration is valid and changes
  292.      nothing.
  293. `-Wnested-externs'
  294.      Warn if an `extern' declaration is encountered within an function.
  295. `-Winline'
  296.      Warn if a function can not be inlined, and either it was declared
  297.      as inline, or else the `-finline-functions' option was given.
  298. `-Woverloaded-virtual'
  299.      Warn when a derived class function declaration may be an error in
  300.      defining a virtual function (C++ only).  In a derived class, the
  301.      definitions of virtual functions must match the type signature of a
  302.      virtual function declared in the base class.  With this option, the
  303.      compiler warns when you define a function with the same name as a
  304.      virtual function, but with a type signature that does not match any
  305.      declarations from the base class.
  306. `-Wsynth (C++ only)'
  307.      Warn when g++'s synthesis behavior does not match that of cfront.
  308.      For instance:
  309.           struct A {
  310.             operator int ();
  311.             A& operator = (int);
  312.           };
  313.           
  314.           main ()
  315.           {
  316.             A a,b;
  317.             a = b;
  318.           }
  319.      In this example, g++ will synthesize a default `A& operator =
  320.      (const A&);', while cfront will use the user-defined `operator ='.
  321. `-Werror'
  322.      Make all warnings into errors.
  323. File: gcc.info,  Node: Debugging Options,  Next: Optimize Options,  Prev: Warning Options,  Up: Invoking GCC
  324. Options for Debugging Your Program or GNU CC
  325. ============================================
  326.    GNU CC has various special options that are used for debugging
  327. either your program or GCC:
  328.      Produce debugging information in the operating system's native
  329.      format (stabs, COFF, XCOFF, or DWARF).  GDB can work with this
  330.      debugging information.
  331.      On most systems that use stabs format, `-g' enables use of extra
  332.      debugging information that only GDB can use; this extra information
  333.      makes debugging work better in GDB but will probably make other
  334.      debuggers crash or refuse to read the program.  If you want to
  335.      control for certain whether to generate the extra information, use
  336.      `-gstabs+', `-gstabs', `-gxcoff+', `-gxcoff', `-gdwarf+', or
  337.      `-gdwarf' (see below).
  338.      Unlike most other C compilers, GNU CC allows you to use `-g' with
  339.      `-O'.  The shortcuts taken by optimized code may occasionally
  340.      produce surprising results: some variables you declared may not
  341.      exist at all; flow of control may briefly move where you did not
  342.      expect it; some statements may not be executed because they
  343.      compute constant results or their values were already at hand;
  344.      some statements may execute in different places because they were
  345.      moved out of loops.
  346.      Nevertheless it proves possible to debug optimized output.  This
  347.      makes it reasonable to use the optimizer for programs that might
  348.      have bugs.
  349.      The following options are useful when GNU CC is generated with the
  350.      capability for more than one debugging format.
  351. `-ggdb'
  352.      Produce debugging information in the native format (if that is
  353.      supported), including GDB extensions if at all possible.
  354. `-gstabs'
  355.      Produce debugging information in stabs format (if that is
  356.      supported), without GDB extensions.  This is the format used by
  357.      DBX on most BSD systems.  On MIPS, Alpha and System V Release 4
  358.      systems this option produces stabs debugging output which is not
  359.      understood by DBX or SDB.  On System V Release 4 systems this
  360.      option requires the GNU assembler.
  361. `-gstabs+'
  362.      Produce debugging information in stabs format (if that is
  363.      supported), using GNU extensions understood only by the GNU
  364.      debugger (GDB).  The use of these extensions is likely to make
  365.      other debuggers crash or refuse to read the program.
  366. `-gcoff'
  367.      Produce debugging information in COFF format (if that is
  368.      supported).  This is the format used by SDB on most System V
  369.      systems prior to System V Release 4.
  370. `-gxcoff'
  371.      Produce debugging information in XCOFF format (if that is
  372.      supported).  This is the format used by the DBX debugger on IBM
  373.      RS/6000 systems.
  374. `-gxcoff+'
  375.      Produce debugging information in XCOFF format (if that is
  376.      supported), using GNU extensions understood only by the GNU
  377.      debugger (GDB).  The use of these extensions is likely to make
  378.      other debuggers crash or refuse to read the program, and may cause
  379.      assemblers other than the GNU assembler (GAS) to fail with an
  380.      error.
  381. `-gdwarf'
  382.      Produce debugging information in DWARF format (if that is
  383.      supported).  This is the format used by SDB on most System V
  384.      Release 4 systems.
  385. `-gdwarf+'
  386.      Produce debugging information in DWARF format (if that is
  387.      supported), using GNU extensions understood only by the GNU
  388.      debugger (GDB).  The use of these extensions is likely to make
  389.      other debuggers crash or refuse to read the program.
  390. `-gLEVEL'
  391. `-ggdbLEVEL'
  392. `-gstabsLEVEL'
  393. `-gcoffLEVEL'
  394. `-gxcoffLEVEL'
  395. `-gdwarfLEVEL'
  396.      Request debugging information and also use LEVEL to specify how
  397.      much information.  The default level is 2.
  398.      Level 1 produces minimal information, enough for making backtraces
  399.      in parts of the program that you don't plan to debug.  This
  400.      includes descriptions of functions and external variables, but no
  401.      information about local variables and no line numbers.
  402.      Level 3 includes extra information, such as all the macro
  403.      definitions present in the program.  Some debuggers support macro
  404.      expansion when you use `-g3'.
  405.      Generate extra code to write profile information suitable for the
  406.      analysis program `prof'.  You must use this option when compiling
  407.      the source files you want data about, and you must also use it when
  408.      linking.
  409. `-pg'
  410.      Generate extra code to write profile information suitable for the
  411.      analysis program `gprof'.  You must use this option when compiling
  412.      the source files you want data about, and you must also use it when
  413.      linking.
  414.      Generate extra code to write profile information for basic blocks,
  415.      which will record the number of times each basic block is
  416.      executed, the basic block start address, and the function name
  417.      containing the basic block.  If `-g' is used, the line number and
  418.      filename of the start of the basic block will also be recorded.
  419.      If not overridden by the machine description, the default action is
  420.      to append to the text file `bb.out'.
  421.      This data could be analyzed by a program like `tcov'.  Note,
  422.      however, that the format of the data is not what `tcov' expects.
  423.      Eventually GNU `gprof' should be extended to process this data.
  424. `-dLETTERS'
  425.      Says to make debugging dumps during compilation at times specified
  426.      by LETTERS.  This is used for debugging the compiler.  The file
  427.      names for most of the dumps are made by appending a word to the
  428.      source file name (e.g.  `foo.c.rtl' or `foo.c.jump').  Here are the
  429.      possible letters for use in LETTERS, and their meanings:
  430.     `M'
  431.           Dump all macro definitions, at the end of preprocessing, and
  432.           write no output.
  433.     `N'
  434.           Dump all macro names, at the end of preprocessing.
  435.     `D'
  436.           Dump all macro definitions, at the end of preprocessing, in
  437.           addition to normal output.
  438.     `y'
  439.           Dump debugging information during parsing, to standard error.
  440.     `r'
  441.           Dump after RTL generation, to `FILE.rtl'.
  442.     `x'
  443.           Just generate RTL for a function instead of compiling it.
  444.           Usually used with `r'.
  445.     `j'
  446.           Dump after first jump optimization, to `FILE.jump'.
  447.     `s'
  448.           Dump after CSE (including the jump optimization that sometimes
  449.           follows CSE), to `FILE.cse'.
  450.     `L'
  451.           Dump after loop optimization, to `FILE.loop'.
  452.     `t'
  453.           Dump after the second CSE pass (including the jump
  454.           optimization that sometimes follows CSE), to `FILE.cse2'.
  455.     `f'
  456.           Dump after flow analysis, to `FILE.flow'.
  457.     `c'
  458.           Dump after instruction combination, to the file
  459.           `FILE.combine'.
  460.     `S'
  461.           Dump after the first instruction scheduling pass, to
  462.           `FILE.sched'.
  463.     `l'
  464.           Dump after local register allocation, to `FILE.lreg'.
  465.     `g'
  466.           Dump after global register allocation, to `FILE.greg'.
  467.     `R'
  468.           Dump after the second instruction scheduling pass, to
  469.           `FILE.sched2'.
  470.     `J'
  471.           Dump after last jump optimization, to `FILE.jump2'.
  472.     `d'
  473.           Dump after delayed branch scheduling, to `FILE.dbr'.
  474.     `k'
  475.           Dump after conversion from registers to stack, to
  476.           `FILE.stack'.
  477.     `a'
  478.           Produce all the dumps listed above.
  479.     `m'
  480.           Print statistics on memory usage, at the end of the run, to
  481.           standard error.
  482.     `p'
  483.           Annotate the assembler output with a comment indicating which
  484.           pattern and alternative was used.
  485. `-fpretend-float'
  486.      When running a cross-compiler, pretend that the target machine
  487.      uses the same floating point format as the host machine.  This
  488.      causes incorrect output of the actual floating constants, but the
  489.      actual instruction sequence will probably be the same as GNU CC
  490.      would make when running on the target machine.
  491. `-save-temps'
  492.      Store the usual "temporary" intermediate files permanently; place
  493.      them in the current directory and name them based on the source
  494.      file.  Thus, compiling `foo.c' with `-c -save-temps' would produce
  495.      files `foo.i' and `foo.s', as well as `foo.o'.
  496. `-print-file-name=LIBRARY'
  497.      Print the full absolute name of the library file LIBRARY that
  498.      would be used when linking--and don't do anything else.  With this
  499.      option, GNU CC does not compile or link anything; it just prints
  500.      the file name.
  501. `-print-prog-name=PROGRAM'
  502.      Like `-print-file-name', but searches for a program such as `cpp'.
  503. `-print-libgcc-file-name'
  504.      Same as `-print-file-name=libgcc.a'.
  505.      This is useful when you use `-nostdlib' or `-nodefaultlibs' but
  506.      you do want to link with `libgcc.a'.  You can do
  507.           gcc -nostdlib FILES... `gcc -print-libgcc-file-name`
  508. `-print-search-dirs'
  509.      Print the name of the configured installation directory and a list
  510.      of program and library directories gcc will search--and don't do
  511.      anything else.
  512.      This is useful when gcc prints the error message `installation
  513.      problem, cannot exec cpp: No such file or directory'.  To resolve
  514.      this you either need to put `cpp' and the other compiler
  515.      components where gcc expects to find them, or you can set the
  516.      environment variable `GCC_EXEC_PREFIX' to the directory where you
  517.      installed them.  Don't forget the trailing '/'.  *Note Environment
  518.      Variables::.
  519. File: gcc.info,  Node: Optimize Options,  Next: Preprocessor Options,  Prev: Debugging Options,  Up: Invoking GCC
  520. Options That Control Optimization
  521. =================================
  522.    These options control various sorts of optimizations:
  523. `-O1'
  524.      Optimize.  Optimizing compilation takes somewhat more time, and a
  525.      lot more memory for a large function.
  526.      Without `-O', the compiler's goal is to reduce the cost of
  527.      compilation and to make debugging produce the expected results.
  528.      Statements are independent: if you stop the program with a
  529.      breakpoint between statements, you can then assign a new value to
  530.      any variable or change the program counter to any other statement
  531.      in the function and get exactly the results you would expect from
  532.      the source code.
  533.      Without `-O', the compiler only allocates variables declared
  534.      `register' in registers.  The resulting compiled code is a little
  535.      worse than produced by PCC without `-O'.
  536.      With `-O', the compiler tries to reduce code size and execution
  537.      time.
  538.      When you specify `-O', the compiler turns on `-fthread-jumps' and
  539.      `-fdefer-pop' on all machines.  The compiler turns on
  540.      `-fdelayed-branch' on machines that have delay slots, and
  541.      `-fomit-frame-pointer' on machines that can support debugging even
  542.      without a frame pointer.  On some machines the compiler also turns
  543.      on other flags.
  544. `-O2'
  545.      Optimize even more.  GNU CC performs nearly all supported
  546.      optimizations that do not involve a space-speed tradeoff.  The
  547.      compiler does not perform loop unrolling or function inlining when
  548.      you specify `-O2'.  As compared to `-O', this option increases
  549.      both compilation time and the performance of the generated code.
  550.      `-O2' turns on all optional optimizations except for loop unrolling
  551.      and function inlining.  It also turns on frame pointer elimination
  552.      on machines where doing so does not interfere with debugging.
  553. `-O3'
  554.      Optimize yet more.  `-O3' turns on all optimizations specified by
  555.      `-O2' and also turns on the `inline-functions' option.
  556. `-O0'
  557.      Do not optimize.
  558.      If you use multiple `-O' options, with or without level numbers,
  559.      the last such option is the one that is effective.
  560.    Options of the form `-fFLAG' specify machine-independent flags.
  561. Most flags have both positive and negative forms; the negative form of
  562. `-ffoo' would be `-fno-foo'.  In the table below, only one of the forms
  563. is listed--the one which is not the default.  You can figure out the
  564. other form by either removing `no-' or adding it.
  565. `-ffloat-store'
  566.      Do not store floating point variables in registers, and inhibit
  567.      other options that might change whether a floating point value is
  568.      taken from a register or memory.
  569.      This option prevents undesirable excess precision on machines such
  570.      as the 68000 where the floating registers (of the 68881) keep more
  571.      precision than a `double' is supposed to have.  For most programs,
  572.      the excess precision does only good, but a few programs rely on the
  573.      precise definition of IEEE floating point.  Use `-ffloat-store' for
  574.      such programs.
  575. `-fno-default-inline'
  576.      Do not make member functions inline by default merely because they
  577.      are defined inside the class scope (C++ only).  Otherwise, when
  578.      you specify `-O', member functions defined inside class scope are
  579.      compiled inline by default; i.e., you don't need to add `inline'
  580.      in front of the member function name.
  581. `-fno-defer-pop'
  582.      Always pop the arguments to each function call as soon as that
  583.      function returns.  For machines which must pop arguments after a
  584.      function call, the compiler normally lets arguments accumulate on
  585.      the stack for several function calls and pops them all at once.
  586. `-fforce-mem'
  587.      Force memory operands to be copied into registers before doing
  588.      arithmetic on them.  This may produce better code by making all
  589.      memory references potential common subexpressions.  When they are
  590.      not common subexpressions, instruction combination should
  591.      eliminate the separate register-load.  I am interested in hearing
  592.      about the difference this makes.
  593. `-fforce-addr'
  594.      Force memory address constants to be copied into registers before
  595.      doing arithmetic on them.  This may produce better code just as
  596.      `-fforce-mem' may.  I am interested in hearing about the
  597.      difference this makes.
  598. `-fomit-frame-pointer'
  599.      Don't keep the frame pointer in a register for functions that
  600.      don't need one.  This avoids the instructions to save, set up and
  601.      restore frame pointers; it also makes an extra register available
  602.      in many functions.  *It also makes debugging impossible on some
  603.      machines.*
  604.      On some machines, such as the Vax, this flag has no effect, because
  605.      the standard calling sequence automatically handles the frame
  606.      pointer and nothing is saved by pretending it doesn't exist.  The
  607.      machine-description macro `FRAME_POINTER_REQUIRED' controls
  608.      whether a target machine supports this flag.  *Note Registers::.
  609. `-fno-inline'
  610.      Don't pay attention to the `inline' keyword.  Normally this option
  611.      is used to keep the compiler from expanding any functions inline.
  612.      Note that if you are not optimizing, no functions can be expanded
  613.      inline.
  614. `-finline-functions'
  615.      Integrate all simple functions into their callers.  The compiler
  616.      heuristically decides which functions are simple enough to be worth
  617.      integrating in this way.
  618.      If all calls to a given function are integrated, and the function
  619.      is declared `static', then the function is normally not output as
  620.      assembler code in its own right.
  621. `-fkeep-inline-functions'
  622.      Even if all calls to a given function are integrated, and the
  623.      function is declared `static', nevertheless output a separate
  624.      run-time callable version of the function.
  625. `-fno-function-cse'
  626.      Do not put function addresses in registers; make each instruction
  627.      that calls a constant function contain the function's address
  628.      explicitly.
  629.      This option results in less efficient code, but some strange hacks
  630.      that alter the assembler output may be confused by the
  631.      optimizations performed when this option is not used.
  632. `-ffast-math'
  633.      This option allows GCC to violate some ANSI or IEEE rules and/or
  634.      specifications in the interest of optimizing code for speed.  For
  635.      example, it allows the compiler to assume arguments to the `sqrt'
  636.      function are non-negative numbers and that no floating-point values
  637.      are NaNs.
  638.      This option should never be turned on by any `-O' option since it
  639.      can result in incorrect output for programs which depend on an
  640.      exact implementation of IEEE or ANSI rules/specifications for math
  641.      functions.
  642.    The following options control specific optimizations.  The `-O2'
  643. option turns on all of these optimizations except `-funroll-loops' and
  644. `-funroll-all-loops'.  On most machines, the `-O' option turns on the
  645. `-fthread-jumps' and `-fdelayed-branch' options, but specific machines
  646. may handle it differently.
  647.    You can use the following flags in the rare cases when "fine-tuning"
  648. of optimizations to be performed is desired.
  649. `-fstrength-reduce'
  650.      Perform the optimizations of loop strength reduction and
  651.      elimination of iteration variables.
  652. `-fthread-jumps'
  653.      Perform optimizations where we check to see if a jump branches to a
  654.      location where another comparison subsumed by the first is found.
  655.      If so, the first branch is redirected to either the destination of
  656.      the second branch or a point immediately following it, depending
  657.      on whether the condition is known to be true or false.
  658. `-fcse-follow-jumps'
  659.      In common subexpression elimination, scan through jump instructions
  660.      when the target of the jump is not reached by any other path.  For
  661.      example, when CSE encounters an `if' statement with an `else'
  662.      clause, CSE will follow the jump when the condition tested is
  663.      false.
  664. `-fcse-skip-blocks'
  665.      This is similar to `-fcse-follow-jumps', but causes CSE to follow
  666.      jumps which conditionally skip over blocks.  When CSE encounters a
  667.      simple `if' statement with no else clause, `-fcse-skip-blocks'
  668.      causes CSE to follow the jump around the body of the `if'.
  669. `-frerun-cse-after-loop'
  670.      Re-run common subexpression elimination after loop optimizations
  671.      has been performed.
  672. `-fexpensive-optimizations'
  673.      Perform a number of minor optimizations that are relatively
  674.      expensive.
  675. `-fdelayed-branch'
  676.      If supported for the target machine, attempt to reorder
  677.      instructions to exploit instruction slots available after delayed
  678.      branch instructions.
  679. `-fschedule-insns'
  680.      If supported for the target machine, attempt to reorder
  681.      instructions to eliminate execution stalls due to required data
  682.      being unavailable.  This helps machines that have slow floating
  683.      point or memory load instructions by allowing other instructions
  684.      to be issued until the result of the load or floating point
  685.      instruction is required.
  686. `-fschedule-insns2'
  687.      Similar to `-fschedule-insns', but requests an additional pass of
  688.      instruction scheduling after register allocation has been done.
  689.      This is especially useful on machines with a relatively small
  690.      number of registers and where memory load instructions take more
  691.      than one cycle.
  692. `-fcaller-saves'
  693.      Enable values to be allocated in registers that will be clobbered
  694.      by function calls, by emitting extra instructions to save and
  695.      restore the registers around such calls.  Such allocation is done
  696.      only when it seems to result in better code than would otherwise
  697.      be produced.
  698.      This option is enabled by default on certain machines, usually
  699.      those which have no call-preserved registers to use instead.
  700. `-funroll-loops'
  701.      Perform the optimization of loop unrolling.  This is only done for
  702.      loops whose number of iterations can be determined at compile time
  703.      or run time.  `-funroll-loop' implies both `-fstrength-reduce' and
  704.      `-frerun-cse-after-loop'.
  705. `-funroll-all-loops'
  706.      Perform the optimization of loop unrolling.  This is done for all
  707.      loops and usually makes programs run more slowly.
  708.      `-funroll-all-loops' implies `-fstrength-reduce' as well as
  709.      `-frerun-cse-after-loop'.
  710. `-fno-peephole'
  711.      Disable any machine-specific peephole optimizations.
  712. File: gcc.info,  Node: Preprocessor Options,  Next: Assembler Options,  Prev: Optimize Options,  Up: Invoking GCC
  713. Options Controlling the Preprocessor
  714. ====================================
  715.    These options control the C preprocessor, which is run on each C
  716. source file before actual compilation.
  717.    If you use the `-E' option, nothing is done except preprocessing.
  718. Some of these options make sense only together with `-E' because they
  719. cause the preprocessor output to be unsuitable for actual compilation.
  720. `-include FILE'
  721.      Process FILE as input before processing the regular input file.
  722.      In effect, the contents of FILE are compiled first.  Any `-D' and
  723.      `-U' options on the command line are always processed before
  724.      `-include FILE', regardless of the order in which they are
  725.      written.  All the `-include' and `-imacros' options are processed
  726.      in the order in which they are written.
  727. `-imacros FILE'
  728.      Process FILE as input, discarding the resulting output, before
  729.      processing the regular input file.  Because the output generated
  730.      from FILE is discarded, the only effect of `-imacros FILE' is to
  731.      make the macros defined in FILE available for use in the main
  732.      input.
  733.      Any `-D' and `-U' options on the command line are always processed
  734.      before `-imacros FILE', regardless of the order in which they are
  735.      written.  All the `-include' and `-imacros' options are processed
  736.      in the order in which they are written.
  737. `-idirafter DIR'
  738.      Add the directory DIR to the second include path.  The directories
  739.      on the second include path are searched when a header file is not
  740.      found in any of the directories in the main include path (the one
  741.      that `-I' adds to).
  742. `-iprefix PREFIX'
  743.      Specify PREFIX as the prefix for subsequent `-iwithprefix' options.
  744. `-iwithprefix DIR'
  745.      Add a directory to the second include path.  The directory's name
  746.      is made by concatenating PREFIX and DIR, where PREFIX was
  747.      specified previously with `-iprefix'.  If you have not specified a
  748.      prefix yet, the directory containing the installed passes of the
  749.      compiler is used as the default.
  750. `-iwithprefixbefore DIR'
  751.      Add a directory to the main include path.  The directory's name is
  752.      made by concatenating PREFIX and DIR, as in the case of
  753.      `-iwithprefix'.
  754. `-isystem DIR'
  755.      Add a directory to the beginning of the second include path,
  756.      marking it as a system directory, so that it gets the same special
  757.      treatment as is applied to the standard system directories.
  758. `-nostdinc'
  759.      Do not search the standard system directories for header files.
  760.      Only the directories you have specified with `-I' options (and the
  761.      current directory, if appropriate) are searched.  *Note Directory
  762.      Options::, for information on `-I'.
  763.      By using both `-nostdinc' and `-I-', you can limit the include-file
  764.      search path to only those directories you specify explicitly.
  765. `-undef'
  766.      Do not predefine any nonstandard macros.  (Including architecture
  767.      flags).
  768.      Run only the C preprocessor.  Preprocess all the C source files
  769.      specified and output the results to standard output or to the
  770.      specified output file.
  771.      Tell the preprocessor not to discard comments.  Used with the `-E'
  772.      option.
  773.      Tell the preprocessor not to generate `#line' directives.  Used
  774.      with the `-E' option.
  775.      Tell the preprocessor to output a rule suitable for `make'
  776.      describing the dependencies of each object file.  For each source
  777.      file, the preprocessor outputs one `make'-rule whose target is the
  778.      object file name for that source file and whose dependencies are
  779.      all the `#include' header files it uses.  This rule may be a
  780.      single line or may be continued with `\'-newline if it is long.
  781.      The list of rules is printed on standard output instead of the
  782.      preprocessed C program.
  783.      `-M' implies `-E'.
  784.      Another way to specify output of a `make' rule is by setting the
  785.      environment variable `DEPENDENCIES_OUTPUT' (*note Environment
  786.      Variables::.).
  787. `-MM'
  788.      Like `-M' but the output mentions only the user header files
  789.      included with `#include "FILE"'.  System header files included
  790.      with `#include <FILE>' are omitted.
  791. `-MD'
  792.      Like `-M' but the dependency information is written to a file made
  793.      by replacing ".c" with ".d" at the end of the input file names.
  794.      This is in addition to compiling the file as specified--`-MD' does
  795.      not inhibit ordinary compilation the way `-M' does.
  796.      In Mach, you can use the utility `md' to merge multiple dependency
  797.      files into a single dependency file suitable for using with the
  798.      `make' command.
  799. `-MMD'
  800.      Like `-MD' except mention only user header files, not system
  801.      header files.
  802. `-MG'
  803.      Treat missing header files as generated files and assume they live
  804.      in the same directory as the source file.  If you specify `-MG',
  805.      you must also specify either `-M' or `-MM'.  `-MG' is not
  806.      supported with `-MD' or `-MMD'.
  807.      Print the name of each header file used, in addition to other
  808.      normal activities.
  809. `-AQUESTION(ANSWER)'
  810.      Assert the answer ANSWER for QUESTION, in case it is tested with a
  811.      preprocessing conditional such as `#if #QUESTION(ANSWER)'.  `-A-'
  812.      disables the standard assertions that normally describe the target
  813.      machine.
  814. `-DMACRO'
  815.      Define macro MACRO with the string `1' as its definition.
  816. `-DMACRO=DEFN'
  817.      Define macro MACRO as DEFN.  All instances of `-D' on the command
  818.      line are processed before any `-U' options.
  819. `-UMACRO'
  820.      Undefine macro MACRO.  `-U' options are evaluated after all `-D'
  821.      options, but before any `-include' and `-imacros' options.
  822. `-dM'
  823.      Tell the preprocessor to output only a list of the macro
  824.      definitions that are in effect at the end of preprocessing.  Used
  825.      with the `-E' option.
  826. `-dD'
  827.      Tell the preprocessing to pass all macro definitions into the
  828.      output, in their proper sequence in the rest of the output.
  829. `-dN'
  830.      Like `-dD' except that the macro arguments and contents are
  831.      omitted.  Only `#define NAME' is included in the output.
  832. `-trigraphs'
  833.      Support ANSI C trigraphs.  The `-ansi' option also has this effect.
  834. `-Wp,OPTION'
  835.      Pass OPTION as an option to the preprocessor.  If OPTION contains
  836.      commas, it is split into multiple options at the commas.
  837. File: gcc.info,  Node: Assembler Options,  Next: Link Options,  Prev: Preprocessor Options,  Up: Invoking GCC
  838. Passing Options to the Assembler
  839. ================================
  840.    You can pass options to the assembler.
  841. `-Wa,OPTION'
  842.      Pass OPTION as an option to the assembler.  If OPTION contains
  843.      commas, it is split into multiple options at the commas.
  844. File: gcc.info,  Node: Link Options,  Next: Directory Options,  Prev: Assembler Options,  Up: Invoking GCC
  845. Options for Linking
  846. ===================
  847.    These options come into play when the compiler links object files
  848. into an executable output file.  They are meaningless if the compiler is
  849. not doing a link step.
  850. `OBJECT-FILE-NAME'
  851.      A file name that does not end in a special recognized suffix is
  852.      considered to name an object file or library.  (Object files are
  853.      distinguished from libraries by the linker according to the file
  854.      contents.)  If linking is done, these object files are used as
  855.      input to the linker.
  856.      If any of these options is used, then the linker is not run, and
  857.      object file names should not be used as arguments.  *Note Overall
  858.      Options::.
  859. `-lLIBRARY'
  860.      Search the library named LIBRARY when linking.
  861.      It makes a difference where in the command you write this option;
  862.      the linker searches processes libraries and object files in the
  863.      order they are specified.  Thus, `foo.o -lz bar.o' searches
  864.      library `z' after file `foo.o' but before `bar.o'.  If `bar.o'
  865.      refers to functions in `z', those functions may not be loaded.
  866.      The linker searches a standard list of directories for the library,
  867.      which is actually a file named `libLIBRARY.a'.  The linker then
  868.      uses this file as if it had been specified precisely by name.
  869.      The directories searched include several standard system
  870.      directories plus any that you specify with `-L'.
  871.      Normally the files found this way are library files--archive files
  872.      whose members are object files.  The linker handles an archive
  873.      file by scanning through it for members which define symbols that
  874.      have so far been referenced but not defined.  But if the file that
  875.      is found is an ordinary object file, it is linked in the usual
  876.      fashion.  The only difference between using an `-l' option and
  877.      specifying a file name is that `-l' surrounds LIBRARY with `lib'
  878.      and `.a' and searches several directories.
  879. `-lobjc'
  880.      You need this special case of the `-l' option in order to link an
  881.      Objective C program.
  882. `-nostartfiles'
  883.      Do not use the standard system startup files when linking.  The
  884.      standard system libraries are used normally, unless `-nostdlib' or
  885.      `-nodefaultlibs' is used.
  886. `-nodefaultlibs'
  887.      Do not use the standard system libraries when linking.  Only the
  888.      libraries you specify will be passed to the linker.  The standard
  889.      startup files are used normally, unless `-nostartfiles' is used.
  890. `-nostdlib'
  891.      Do not use the standard system startup files or libraries when
  892.      linking.  No startup files and only the libraries you specify will
  893.      be passed to the linker.
  894.      One of the standard libraries bypassed by `-nostdlib' and
  895.      `-nodefaultlibs' is `libgcc.a', a library of internal subroutines
  896.      that GNU CC uses to overcome shortcomings of particular machines,
  897.      or special needs for some languages.  (*Note Interfacing to GNU CC
  898.      Output: Interface, for more discussion of `libgcc.a'.) In most
  899.      cases, you need `libgcc.a' even when you want to avoid other
  900.      standard libraries.  In other words, when you specify `-nostdlib'
  901.      or `-nodefaultlibs' you should usually specify `-lgcc' as well.
  902.      This ensures that you have no unresolved references to internal
  903.      GNU CC library subroutines.  (For example, `__main', used to
  904.      ensure C++ constructors will be called; *note `collect2':
  905.      Collect2..)
  906.      Remove all symbol table and relocation information from the
  907.      executable.
  908. `-static'
  909.      On systems that support dynamic linking, this prevents linking
  910.      with the shared libraries.  On other systems, this option has no
  911.      effect.
  912. `-shared'
  913.      Produce a shared object which can then be linked with other
  914.      objects to form an executable.  Only a few systems support this
  915.      option.
  916. `-symbolic'
  917.      Bind references to global symbols when building a shared object.
  918.      Warn about any unresolved references (unless overridden by the
  919.      link editor option `-Xlinker -z -Xlinker defs').  Only a few
  920.      systems support this option.
  921. `-Xlinker OPTION'
  922.      Pass OPTION as an option to the linker.  You can use this to
  923.      supply system-specific linker options which GNU CC does not know
  924.      how to recognize.
  925.      If you want to pass an option that takes an argument, you must use
  926.      `-Xlinker' twice, once for the option and once for the argument.
  927.      For example, to pass `-assert definitions', you must write
  928.      `-Xlinker -assert -Xlinker definitions'.  It does not work to write
  929.      `-Xlinker "-assert definitions"', because this passes the entire
  930.      string as a single argument, which is not what the linker expects.
  931. `-Wl,OPTION'
  932.      Pass OPTION as an option to the linker.  If OPTION contains
  933.      commas, it is split into multiple options at the commas.
  934. `-u SYMBOL'
  935.      Pretend the symbol SYMBOL is undefined, to force linking of
  936.      library modules to define it.  You can use `-u' multiple times with
  937.      different symbols to force loading of additional library modules.
  938.